
_delay:
;tuv-c95-nkeb.c,23 :: 		void delay(){
;tuv-c95-nkeb.c,25 :: 		for(i=0; i<10; i++)
	MOV delay_i_L0+0, #0
	MOV delay_i_L0+1, #0
L_delay0:
	CLR C
	MOV A, delay_i_L0+0
	SUBB A, #10
	MOV A, #0
	XRL A, #128
	MOV R0, A
	MOV A, delay_i_L0+1
	XRL A, #128
	SUBB A, R0
	JNC L_delay1
;tuv-c95-nkeb.c,26 :: 		continue ;
L_delay2:
;tuv-c95-nkeb.c,25 :: 		for(i=0; i<10; i++)
	MOV A, #1
	ADD A, delay_i_L0+0
	MOV delay_i_L0+0, A
	MOV A, #0
	ADDC A, delay_i_L0+1
	MOV delay_i_L0+1, A
;tuv-c95-nkeb.c,26 :: 		continue ;
	SJMP L_delay0
L_delay1:
;tuv-c95-nkeb.c,27 :: 		}
	RET
; end of _delay

_trigger:
;tuv-c95-nkeb.c,29 :: 		void trigger(){
;tuv-c95-nkeb.c,30 :: 		GLCD_EN = 1;
	SETB 166
;tuv-c95-nkeb.c,31 :: 		delay();
	LCALL _delay+0
;tuv-c95-nkeb.c,32 :: 		GLCD_EN = 0;
	CLR 166
;tuv-c95-nkeb.c,33 :: 		delay();
	LCALL _delay+0
;tuv-c95-nkeb.c,34 :: 		}
	RET
; end of _trigger

_select_row:
;tuv-c95-nkeb.c,37 :: 		void select_row(short addr){
;tuv-c95-nkeb.c,38 :: 		GLCD_RS = 0;
	CLR 164
;tuv-c95-nkeb.c,39 :: 		GLCD_RW = 0;
	CLR 165
;tuv-c95-nkeb.c,40 :: 		addr |= 0xB8;
	MOV A, FARG_select_row+0+0
	ORL A, #184
	MOV R0, A
	MOV FARG_select_row+0+0, 0
;tuv-c95-nkeb.c,41 :: 		addr &= 0xBF;
	MOV A, R0
	ANL A, #191
	MOV R0, A
	MOV FARG_select_row+0+0, 0
;tuv-c95-nkeb.c,42 :: 		GLCD_DataPort = addr;
	MOV 128, 0
;tuv-c95-nkeb.c,44 :: 		trigger();
	LCALL _trigger+0
;tuv-c95-nkeb.c,45 :: 		}
	RET
; end of _select_row

_select_col:
;tuv-c95-nkeb.c,48 :: 		void select_col(short addr){
;tuv-c95-nkeb.c,49 :: 		GLCD_RS = 0;
	CLR 164
;tuv-c95-nkeb.c,50 :: 		GLCD_RW = 0;
	CLR 165
;tuv-c95-nkeb.c,51 :: 		addr |= 0x40;
	MOV A, FARG_select_col+0+0
	ORL A, #64
	MOV R0, A
	MOV FARG_select_col+0+0, 0
;tuv-c95-nkeb.c,52 :: 		addr &= 0x7F;
	MOV A, R0
	ANL A, #127
	MOV R0, A
	MOV FARG_select_col+0+0, 0
;tuv-c95-nkeb.c,53 :: 		GLCD_DataPort = addr;
	MOV 128, 0
;tuv-c95-nkeb.c,54 :: 		trigger();
	LCALL _trigger+0
;tuv-c95-nkeb.c,55 :: 		}
	RET
; end of _select_col

_select_left:
;tuv-c95-nkeb.c,57 :: 		void select_left(){
;tuv-c95-nkeb.c,58 :: 		GLCD_CS1 = 0;
	CLR 162
;tuv-c95-nkeb.c,59 :: 		GLCD_CS2 = 1;
	SETB 163
;tuv-c95-nkeb.c,60 :: 		}
	RET
; end of _select_left

_select_right:
;tuv-c95-nkeb.c,62 :: 		void select_right(){
;tuv-c95-nkeb.c,63 :: 		GLCD_CS1 = 1;
	SETB 162
;tuv-c95-nkeb.c,64 :: 		GLCD_CS2 = 0;
	CLR 163
;tuv-c95-nkeb.c,65 :: 		}
	RET
; end of _select_right

_write:
;tuv-c95-nkeb.c,67 :: 		void write(short byte){
;tuv-c95-nkeb.c,68 :: 		GLCD_RS = 1;
	SETB 164
;tuv-c95-nkeb.c,69 :: 		GLCD_RW = 0;
	CLR 165
;tuv-c95-nkeb.c,70 :: 		GLCD_DataPort = byte;
	MOV 128, FARG_write+0+0
;tuv-c95-nkeb.c,71 :: 		trigger();
	LCALL _trigger+0
;tuv-c95-nkeb.c,72 :: 		}
	RET
; end of _write

_fill_half:
;tuv-c95-nkeb.c,74 :: 		void fill_half(short byte){
;tuv-c95-nkeb.c,76 :: 		for(i=0; i<8; i++){
	MOV fill_half_i_L0+0, #0
	MOV fill_half_i_L0+1, #0
L_fill_half3:
	CLR C
	MOV A, fill_half_i_L0+0
	SUBB A, #8
	MOV A, #0
	XRL A, #128
	MOV R0, A
	MOV A, fill_half_i_L0+1
	XRL A, #128
	SUBB A, R0
	JNC L_fill_half4
;tuv-c95-nkeb.c,77 :: 		select_row(i);
	MOV FARG_select_row+0+0, fill_half_i_L0+0
	LCALL _select_row+0
;tuv-c95-nkeb.c,78 :: 		for(j=0; j<64; j++){
	MOV fill_half_j_L0+0, #0
	MOV fill_half_j_L0+1, #0
L_fill_half6:
	CLR C
	MOV A, fill_half_j_L0+0
	SUBB A, #64
	MOV A, #0
	XRL A, #128
	MOV R0, A
	MOV A, fill_half_j_L0+1
	XRL A, #128
	SUBB A, R0
	JNC L_fill_half7
;tuv-c95-nkeb.c,79 :: 		select_col(j);
	MOV FARG_select_col+0+0, fill_half_j_L0+0
	LCALL _select_col+0
;tuv-c95-nkeb.c,80 :: 		write(byte);
	MOV FARG_write+0+0, FARG_fill_half+0+0
	LCALL _write+0
;tuv-c95-nkeb.c,81 :: 		}
L_fill_half8:
;tuv-c95-nkeb.c,78 :: 		for(j=0; j<64; j++){
	MOV A, #1
	ADD A, fill_half_j_L0+0
	MOV fill_half_j_L0+0, A
	MOV A, #0
	ADDC A, fill_half_j_L0+1
	MOV fill_half_j_L0+1, A
;tuv-c95-nkeb.c,81 :: 		}
	SJMP L_fill_half6
L_fill_half7:
;tuv-c95-nkeb.c,82 :: 		}
L_fill_half5:
;tuv-c95-nkeb.c,76 :: 		for(i=0; i<8; i++){
	MOV A, #1
	ADD A, fill_half_i_L0+0
	MOV fill_half_i_L0+0, A
	MOV A, #0
	ADDC A, fill_half_i_L0+1
	MOV fill_half_i_L0+1, A
;tuv-c95-nkeb.c,82 :: 		}
	SJMP L_fill_half3
L_fill_half4:
;tuv-c95-nkeb.c,83 :: 		}
	RET
; end of _fill_half

_fill_display:
;tuv-c95-nkeb.c,85 :: 		void fill_display(short byte){
;tuv-c95-nkeb.c,86 :: 		select_left();
	LCALL _select_left+0
;tuv-c95-nkeb.c,87 :: 		fill_half(byte);
	MOV FARG_fill_half+0+0, FARG_fill_display+0+0
	LCALL _fill_half+0
;tuv-c95-nkeb.c,88 :: 		select_right();
	LCALL _select_right+0
;tuv-c95-nkeb.c,89 :: 		fill_half(byte);
	MOV FARG_fill_half+0+0, FARG_fill_display+0+0
	LCALL _fill_half+0
;tuv-c95-nkeb.c,90 :: 		select_left();
	LCALL _select_left+0
;tuv-c95-nkeb.c,92 :: 		}void init(){
	RET
; end of _fill_display

_init:
;tuv-c95-nkeb.c,93 :: 		CURRENT_COL = 0;
	MOV _CURRENT_COL+0, #0
;tuv-c95-nkeb.c,94 :: 		CURRENT_ROW = 0;
	MOV _CURRENT_ROW+0, #0
;tuv-c95-nkeb.c,96 :: 		GLCD_CS1 = 0;
	CLR 162
;tuv-c95-nkeb.c,97 :: 		GLCD_CS2 = 0;
	CLR 163
;tuv-c95-nkeb.c,98 :: 		GLCD_RST = 1;
	SETB 167
;tuv-c95-nkeb.c,99 :: 		GLCD_EN = 0;
	CLR 166
;tuv-c95-nkeb.c,101 :: 		GLCD_RS = 0;
	CLR 164
;tuv-c95-nkeb.c,102 :: 		GLCD_RW = 0;
	CLR 165
;tuv-c95-nkeb.c,103 :: 		GLCD_DataPort = 0x3F;
	MOV 128, #63
;tuv-c95-nkeb.c,104 :: 		trigger();
	LCALL _trigger+0
;tuv-c95-nkeb.c,106 :: 		select_row(0);
	MOV FARG_select_row+0+0, #0
	LCALL _select_row+0
;tuv-c95-nkeb.c,107 :: 		select_col(0);
	MOV FARG_select_col+0+0, #0
	LCALL _select_col+0
;tuv-c95-nkeb.c,108 :: 		select_left();
	LCALL _select_left+0
;tuv-c95-nkeb.c,109 :: 		}
	RET
; end of _init

_init_com:
;tuv-c95-nkeb.c,111 :: 		void init_com(){
;tuv-c95-nkeb.c,112 :: 		SM0 = 0;
	CLR 159
;tuv-c95-nkeb.c,113 :: 		SM2 = 0;
	CLR 157
;tuv-c95-nkeb.c,114 :: 		SM1 = 1;
	SETB 158
;tuv-c95-nkeb.c,115 :: 		REN = 1;
	SETB 156
;tuv-c95-nkeb.c,116 :: 		PCON |=  128;
	ORL 135, #128
;tuv-c95-nkeb.c,118 :: 		TH1 = 245;
	MOV 141, #245
;tuv-c95-nkeb.c,119 :: 		TH0 = 253;
	MOV 140, #253
;tuv-c95-nkeb.c,120 :: 		TMOD |= 32;
	MOV A, 137
	ORL A, #32
	MOV R0, A
	MOV 137, 0
;tuv-c95-nkeb.c,121 :: 		TMOD &= 47;
	MOV A, R0
	ANL A, #47
	MOV 137, A
;tuv-c95-nkeb.c,122 :: 		TCON |= 64;
	ORL 136, #64
;tuv-c95-nkeb.c,123 :: 		}
	RET
; end of _init_com

_com_send:
;tuv-c95-nkeb.c,125 :: 		void com_send(short byte){
;tuv-c95-nkeb.c,126 :: 		P3 = 2;
	MOV 176, #2
;tuv-c95-nkeb.c,127 :: 		SBUF = byte;
	MOV 153, FARG_com_send+0+0
;tuv-c95-nkeb.c,128 :: 		while(TI == 0)
L_com_send9:
	MOV C, 153
	CLR A
	RLC A
	MOV R1, A
	XRL A, #0
	JNZ L_com_send10
;tuv-c95-nkeb.c,129 :: 		continue;
	SJMP L_com_send9
L_com_send10:
;tuv-c95-nkeb.c,130 :: 		TI = 0;
	CLR 153
;tuv-c95-nkeb.c,131 :: 		}
	RET
; end of _com_send

_com_receive:
;tuv-c95-nkeb.c,133 :: 		unsigned short com_receive(){
;tuv-c95-nkeb.c,135 :: 		while(RI == 0)
L_com_receive11:
	MOV C, 152
	CLR A
	RLC A
	MOV R1, A
	XRL A, #0
	JNZ L_com_receive12
;tuv-c95-nkeb.c,136 :: 		continue;
	SJMP L_com_receive11
L_com_receive12:
;tuv-c95-nkeb.c,139 :: 		RI = 0;
	CLR 152
;tuv-c95-nkeb.c,140 :: 		return result;
	MOV R0, 153
;tuv-c95-nkeb.c,141 :: 		}
	RET
; end of _com_receive

_draw_byte:
;tuv-c95-nkeb.c,143 :: 		void draw_byte(unsigned short byte, short row, short col){ //col (0..127)
;tuv-c95-nkeb.c,144 :: 		enum side side_ = col > 63;   //0 -> LEFT_, 1 -> RIGHT_
	SETB C
	MOV A, #63
	XRL A, #128
	MOV R1, A
	MOV A, FARG_draw_byte+2+0
	XRL A, #128
	SUBB A, R1
	JNC L__draw_byte20
	MOV R1, #0
	SJMP L__draw_byte21
L__draw_byte20:
	MOV R1, #1
L__draw_byte21:
;tuv-c95-nkeb.c,146 :: 		if(side_ == RIGHT_){
	MOV A, R1
	XRL A, #1
	JNZ L_draw_byte13
;tuv-c95-nkeb.c,147 :: 		select_right();
	LCALL _select_right+0
;tuv-c95-nkeb.c,148 :: 		col = col - 64;
	CLR C
	MOV A, FARG_draw_byte+2+0
	SUBB A, #64
	MOV FARG_draw_byte+2+0, A
;tuv-c95-nkeb.c,149 :: 		}else
	SJMP L_draw_byte14
L_draw_byte13:
;tuv-c95-nkeb.c,150 :: 		select_left();
	LCALL _select_left+0
L_draw_byte14:
;tuv-c95-nkeb.c,151 :: 		select_row(row);
	MOV FARG_select_row+0+0, FARG_draw_byte+1+0
	LCALL _select_row+0
;tuv-c95-nkeb.c,152 :: 		select_col(col);
	MOV FARG_select_col+0+0, FARG_draw_byte+2+0
	LCALL _select_col+0
;tuv-c95-nkeb.c,154 :: 		write(byte);
	MOV FARG_write+0+0, FARG_draw_byte+0+0
	LCALL _write+0
;tuv-c95-nkeb.c,155 :: 		}
	RET
; end of _draw_byte

_insert_current_byte:
;tuv-c95-nkeb.c,157 :: 		void insert_current_byte(unsigned short byte){
;tuv-c95-nkeb.c,158 :: 		draw_byte(byte, CURRENT_ROW, CURRENT_COL);
	MOV FARG_draw_byte+0+0, FARG_insert_current_byte+0+0
	MOV FARG_draw_byte+1+0, _CURRENT_ROW+0
	MOV FARG_draw_byte+2+0, _CURRENT_COL+0
	LCALL _draw_byte+0
;tuv-c95-nkeb.c,159 :: 		CURRENT_COL++;
	INC _CURRENT_COL+0
;tuv-c95-nkeb.c,160 :: 		if (CURRENT_COL == 128){
	MOV A, _CURRENT_COL+0
	XRL A, #128
	JNZ L_insert_current_byte15
;tuv-c95-nkeb.c,161 :: 		CURRENT_COL = 0;
	MOV _CURRENT_COL+0, #0
;tuv-c95-nkeb.c,162 :: 		CURRENT_ROW++;
	INC _CURRENT_ROW+0
;tuv-c95-nkeb.c,163 :: 		}
L_insert_current_byte15:
;tuv-c95-nkeb.c,164 :: 		}
	RET
; end of _insert_current_byte

_main:
	MOV 129, #128
;tuv-c95-nkeb.c,166 :: 		void main() {
;tuv-c95-nkeb.c,171 :: 		init();
	LCALL _init+0
;tuv-c95-nkeb.c,172 :: 		fill_display(0);
	MOV FARG_fill_display+0+0, #0
	LCALL _fill_display+0
;tuv-c95-nkeb.c,173 :: 		init_com();
	LCALL _init_com+0
;tuv-c95-nkeb.c,174 :: 		while(1==1){
L_main16:
;tuv-c95-nkeb.c,175 :: 		insert_current_byte( com_receive() );
	LCALL _com_receive+0
	MOV FARG_insert_current_byte+0+0, 0
	LCALL _insert_current_byte+0
;tuv-c95-nkeb.c,176 :: 		insert_current_byte(255);
	MOV FARG_insert_current_byte+0+0, #255
	LCALL _insert_current_byte+0
;tuv-c95-nkeb.c,177 :: 		}
	SJMP L_main16
;tuv-c95-nkeb.c,194 :: 		}
	SJMP #254
; end of _main
